home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Peter's Final Project / src / sector.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  2.1 KB  |  67 lines  |  [TEXT/KAHL]

  1. /*
  2.  *  Peter's Final Project -- A texture mapping demonstration
  3.  *  © 1995, Peter Mattis
  4.  *
  5.  *  E-mail:
  6.  *  petm@soda.csua.berkeley.edu
  7.  *
  8.  *  Snail-mail:
  9.  *   Peter Mattis
  10.  *   557 Fort Laramie Dr.
  11.  *   Sunnyvale, CA 94087
  12.  *
  13.  *  Avaible from:
  14.  *  http://www.csua.berkeley.edu/~petm/final.html
  15.  *
  16.  *  This program is free software; you can redistribute it and/or modify
  17.  *  it under the terms of the GNU General Public License as published by
  18.  *  the Free Software Foundation; either version 2 of the License, or
  19.  *  (at your option) any later version.
  20.  *
  21.  *  This program is distributed in the hope that it will be useful,
  22.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *  GNU General Public License for more details.
  25.  *
  26.  *  You should have received a copy of the GNU General Public License
  27.  *  along with this program; if not, write to the Free Software
  28.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  */
  30.  
  31. #ifndef __SECTOR_H__
  32. #define __SECTOR_H__
  33.  
  34. #include "face.h"
  35.  
  36. SECTOR make_sector (void);
  37. void free_sector (SECTOR);
  38.  
  39. SECTORS sectors_last (SECTORS);
  40. SECTORS sectors_append_sector (SECTORS, SECTOR);
  41. SECTORS sectors_prepend_sector (SECTORS, SECTOR);
  42. void free_sectors (SECTORS);
  43.  
  44. long sector_mem_usage (void);
  45.  
  46. #define sector_val(s)        ((s)->val)
  47. #define sector_faces(s)      ((s)->faces)
  48. #define sector_objects(s)    ((s)->objects)
  49. #define sector_neighbors(s)  ((s)->neighbors)
  50.  
  51. #define set_sector_val(s, k)        (sector_val(s) = (k))
  52. #define set_sector_faces(s, k)      (sector_faces(s) = (k))
  53. #define set_sector_objects(s, k)    (sector_objects(s) = (k))
  54. #define set_sector_neighbors(s, k)  (sector_neighbors(s) = (k))
  55.  
  56. #define sectors_first(p)   ((SECTOR) list_datum((LIST) p))
  57. #define sectors_rest(p)    ((SECTORS) list_next((LIST) p))
  58. #define sectors_prev(p)    ((SECTORS) list_prev((LIST) p))
  59.  
  60. #define set_sectors_first(p, k)  (set_list_datum((LIST) p, k))
  61. #define set_sectors_rest(p, k)   (set_list_next((LIST) p, k))
  62. #define set_sectors_prev(p, k)   (set_list_prev((LIST) p, k))
  63.  
  64. #define sectors_add_sector  sectors_prepend_sector
  65.  
  66. #endif /* __SECTOR_H__ */
  67.